package control;

import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;

import view.TeraFootMain;

/**
 * @uthor BWH
 */

public class AdjustListener implements AdjustmentListener {
	TeraFootMain teraFootMain;

	public AdjustListener(TeraFootMain teraFootMain) {
		this.teraFootMain = teraFootMain;
	}

	@Override
	public void adjustmentValueChanged(AdjustmentEvent e) {

		final int year = Integer.parseInt(""
				+ teraFootMain.getcP().getGUI_Kalender().getComboBox()
						.getSelectedItem());
		final int week = e.getValue();

		teraFootMain.getcP().getGUI_Kalender().getComboBoxUge()
				.setSelectedIndex(+e.getValue() - 1);
		teraFootMain.getcP().getGUI_Kalender().refreshTable(year, week);
		teraFootMain.getcP().getGUI_Kalender().getScrollBar()
				.setToolTipText("" + e.getValue());
	}

}
